package com.d0310;
//父类
public abstract class Lock {
    public abstract void open();//抽象方法，只有方法签名，没有方法体
    public abstract void close();
}
class FingerprintLock extends Lock{
    @Override
    public void close() {

    }

    @Override
    public void open() {
        System.out.println("open指纹锁");
    }
}
class FaceLock extends Lock{
    //派生类实现了抽象类里的抽象方法

    @Override
    public void close() {

    }

    @Override
    public void open() {
        System.out.println("open人脸识别");
    }
}
class TestLock{
    public static void main(String[] args) {
        //Lock lock=new Lock();//错误 抽象类不能实例化；
        FingerprintLock fingerprintLock=new FingerprintLock();
        fingerprintLock.open();
        FaceLock faceLock=new FaceLock();
        faceLock.open();

    }
}